/* operation.cpp */

#include <dodo_plot/kernel/operation.h>
#include <dodo_plot/kernel/basic_elements.h>
#include <dodo_plot/kernel/picture.h>
#include <dodo_plot/kernel/p_node.h>
//#include <dodo_plot/kernel/hv_cat_pic.h>
#include <dodo_plot/kernel/combi_pic.h>
#include <dodo_plot/kernel/frame_pic.h>

#include <cairomm/cairomm.h>

namespace dodo_plot
{

Picture operator| (const Picture& left, const Picture& right) 
{ 
        return combi(left, right, RIGHT); 
} 
 
Picture operator& (const Picture& top, const Picture& bottom) 
{ 
        return combi(top, bottom, BOTTOM); 
} 

Picture operator+ (const Picture& lower_layer, const Picture& upper_layer) 
{ 
        return combi(lower_layer, upper_layer); 
} 

Picture combi(const Picture& lower, const Picture& upper, 
      double x_offset, double y_offset)
{
      return Picture(new Combi_Pic(lower, upper, x_offset, y_offset), 1);
}

Picture combi(const Picture& lower, const Picture& upper, 
        int mode,  
        double extra_x_offset, double extra_y_offset) 
{ 
        return Picture(new Combi_Pic(lower, upper, 
                mode,  
                extra_x_offset, extra_y_offset),
		1
		); 
}

Picture frame(const Picture& picture, double w, double h, bool crop)
{
	return Picture(new Frame_Pic(picture, w, h, crop), 1);
}


}
